﻿using System;
using System.Runtime.InteropServices;
using System.Text;
using PinLib;
using pinlib.constants;


/* cannot find def */
//AlignRects
//AllowForegroundActivation


namespace pinlib.structs
{
    internal static class User32Native
    {

        /// <summary>Sets the input locale identifier (formerly called the keyboard layout handle) for the calling thread or the current process. The input locale identifier specifies a locale as well as the physical layout of the keyboard</summary>
        /// <param name="hkl">Input locale identifier to be activated.</param>
        /// <param name="Flags">Specifies how the input locale identifier is to be activated.</param>
        /// <returns>The return value is of type HKL. If the function succeeds, the return value is the previous input locale identifier. Otherwise, it is zero</returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms646289(VS.85).aspx</remarks>
        /// <seealso cref="KLF"/>
        /// <seealso cref="HKL"/>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern HKL ActivateKeyboardLayout(HKL hkl, uint Flags);

        
        /// <summary>Places the given window in the system-maintained clipboard format listener list.</summary>
        /// <param name="hwnd">A handle to the window to be placed in the clipboard format listener list.</param>
        /// <returns>Returns TRUE if successful, FALSE otherwise</returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms649033(VS.85).aspx</remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AddClipboardFormatListener(IntPtr hwnd);


        /// <summary>
        /// Calculates the required size of the window rectangle, based on the desired
        /// client-rectangle size. The window rectangle can then be passed to the
        /// CreateWindow function to create a window whose client area is the desired size.
        /// </summary>
        /// <param name="lpRect">A pointer to a RECT structure that contains the coordinates
        /// of the top-left and bottom-right corners of the desired client area</param>
        /// <param name="dwStyle">The window style of the window whose required size is to be calculated.</param>
        /// <param name="bMenu">Indicates whether the window has a menu</param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        /// <remarks>
        /// http://msdn.microsoft.com/en-us/library/ms632665(v=vs.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AdjustWindowRect(ref GDIStructures.RECT lpRect, uint dwStyle, bool bMenu);


        /// <summary>
        /// Calculates the required size of the window rectangle, based on the desired size of the client rectangle.
        /// </summary>
        /// <param name="lpRect">A pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area</param>
        /// <param name="dwStyle">The window style of the window whose required size is to be calculated. Note that you cannot specify the WS_OVERLAPPED style <see cref="WS"/></param>
        /// <param name="bMenu">Indicates whether the window has a menu</param>
        /// <param name="dwExStyle">The extended window style of the window whose required size is to be calculated. <see cref="WS_EX"/></param>
        /// <returns>
        /// If the function succeeds, the return value is nonzero, otherwise 0
        /// </returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AdjustWindowRectEx(out GDIStructures.RECT lpRect,int dwStyle,bool bMenu, int dwExStyle);

        /// <summary>
        /// Enables the specified process to set the foreground window using the SetForegroundWindow function. The calling process must already be able to set the foreground window
        /// </summary>
        /// <param name="dwProcessId">The identifier of the process that will be enabled to set the foreground window</param>
        /// <returns>
        /// If the function succeeds, the return value is nonzero, otherwise 0
        /// </returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool  AllowSetForegroundWindow(int dwProcessId);


        /// <summary>
        /// Enables you to produce special effects when showing or hiding windows.
        /// There are four types of animation: roll, slide, collapse or expand, and alpha-blended fade
        /// </summary>
        /// <param name="hWnd">A handle to the window to animate. The calling thread must own this window</param>
        /// <param name="dwTime">The time it takes to play the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play</param>
        /// <param name="dwFlags">The type of animation <see cref="AW"/></param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms632669(VS.85).aspx</remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AnimateWindow(IntPtr hWnd, uint dwTime, uint dwFlags);


        /// <summary>
        /// Indicates whether an owned, visible, top-level pop-up, or overlapped window exists on the screen. The function searches the entire screen, not just the calling application's client area.
        /// </summary>
        /// <returns>
        /// If a pop-up window exists, the return value is nonzero, even if the pop-up window is completely covered by other windows. If a pop-up window does not exist, the return value is zero.
        /// </returns>
        /// <remarks>
        /// This function is provided only for compatibility with 16-bit versions of Windows. It is generally not useful
        /// This function does not detect unowned pop-up windows or windows that do not have the WS_VISIBLE style bit set
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AnyPopup();

        /// <summary>
        /// Appends a new item to the end of the specified menu bar, drop-down menu, submenu, or shortcut menu. You can use this function to specify the content, appearance, and behavior of the menu item
        /// </summary>
        /// <param name="hMenu">A handle to the menu bar, drop-down menu, submenu, or shortcut menu to be changed.</param>
        /// <param name="uFlags">Controls the appearance and behavior of the new menu item. <see cref="MF"/></param>
        /// <param name="uIDNewItem">The identifier of the new menu item or, if the uFlags parameter is set to MF_POPUP, a handle to the drop-down menu or submenu.</param>
        /// <param name="lpNewItem">The content of the new menu item</param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AppendMenu(IntPtr hMenu, uint uFlags,uint uIDNewItem, StringBuilder lpNewItem);


        /// <summary>
        /// Arranges all the minimized (iconic) child windows of the specified parent window
        /// </summary>
        /// <param name="hWnd">A handle to the parent window</param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms632671(VS.85).aspx</remarks>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern uint ArrangeIconicWindows(IntPtr hWnd);


        /// <summary>
        /// Attaches or detaches the input processing mechanism of one thread to that of another thread.
        /// </summary>
        /// <param name="idAttach">The identifier of the thread to be attached to another thread. The thread to be attached cannot be a system thread.</param>
        /// <param name="idAttachTo">The identifier of the thread to which idAttach will be attached. This thread cannot be a system thread.</param>
        /// <param name="fAttach">if set to <c>true</c> [f attach].</param>
        /// <returns>
        /// If this parameter is TRUE, the two threads are attached. If the parameter is FALSE, the threads are detached
        /// </returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms681956(VS.85).aspx</remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool AttachThreadInput(int idAttach, int idAttachTo, bool fAttach);

        //TODO: BeginDeferWindowPos - find out what HDWP can be marshaled as
        //HDWP  BeginDeferWindowPos(int nNumWindows);


        /// <summary>
        /// The BeginPaint function prepares the specified window for painting and fills a PAINTSTRUCT structure with information about the painting
        /// </summary>
        /// <param name="hwnd">Handle to the window to be repainted.</param>
        /// <param name="lpPaint">Pointer to the PAINTSTRUCT structure that will receive painting information</param>
        /// <returns>
        /// If the function succeeds, the return value is the handle to a display device context for the specified window.If the function fails, the return value is NULL, indicating that no display device context is available
        /// </returns>
        /// <remarks>
        /// http://msdn.microsoft.com/en-us/library/dd183362(v=VS.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr BeginPaint(IntPtr hwnd, out PAINTSTRUCT lpPaint);


        /// <summary>
        /// Blocks keyboard and mouse input events from reaching applications.
        /// </summary>
        /// <param name="fBlockIt">The function's purpose. If this parameter is TRUE, keyboard and mouse input events are blocked. If this parameter is FALSE, keyboard and mouse events are unblocked. Note that only the thread that blocked input can successfully unblock input.</param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        /// <remarks>http://msdn.microsoft.com/en-us/library/ms646290(VS.85).aspx</remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool BlockInput(bool fBlockIt);


        /// <summary>
        /// Brings the specified window to the top of the Z order.
        /// If the window is a top-level window, it is activated.
        /// If the window is a child window, the top-level parent window associated with the child window is activated
        /// </summary>
        /// <param name="hWnd">A handle to the window to bring to the top of the Z order.</param>
        /// <returns>If the function succeeds, the return value is nonzero</returns>
        /// <remarks>
        /// http://msdn.microsoft.com/en-us/library/ms632673(v=vs.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool BringWindowToTop(IntPtr hWnd);



        /// <summary>Sends a message to the specified recipients. The recipients can be applications, installable drivers, network drivers, system-level device drivers, or any combination of these system components.</summary>
        /// <param name="dwFlags">The dw flags.</param>
        /// <param name="lpdwRecipients">The LPDW recipients.</param>
        /// <param name="uiMessage">The UI message.</param>
        /// <param name="wParam">The w param.</param>
        /// <param name="lParam">The l param.</param>
        /// <returns></returns>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern long BroadcastSystemMessage(int dwFlags,LPDWORD lpdwRecipients,uint uiMessage, int wParam, int lParam);

        //BroadcastSystemMessageExA
        //BroadcastSystemMessageExW
        //BroadcastSystemMessageW
        //BuildReasonArray
        //CalcMenuBar
        //CalculatePopupWindowPosition
        //CallMsgFilter
        //CallMsgFilterA
        //CallMsgFilterW
        //CallNextHookEx
        //CallWindowProcA
        //CallWindowProcW
        //CancelShutdown
        //CascadeChildWindows
        //CascadeWindows
        //ChangeClipboardChain
        //ChangeDisplaySettingsA
        //ChangeDisplaySettingsExA
        //ChangeDisplaySettingsExW
        //ChangeDisplaySettingsW
        //ChangeMenuA
        //ChangeMenuW
        //ChangeWindowMessageFilter

        /// <summary>
        ///   Modifies the User Interface Privilege Isolation (UIPI) message filter for a specified window
        /// </summary>
        /// <param name = "hWnd">A handle to the window whose UIPI message filter is to be modified</param>
        /// <param name = "message">The message that the message filter allows through or blocks</param>
        /// <param name = "action">The action to be performed</param>
        /// <param name = "pChangeFilterStruct"> Optional pointer to a CHANGEFILTERSTRUCT structure</param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        /// <remarks>
        ///   http://msdn.microsoft.com/en-us/library/dd388202(VS.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool ChangeWindowMessageFilterEx(IntPtr hWnd, uint message, uint action, ref CHANGEFILTERSTRUCT pChangeFilterStruct);

        //CharLowerA
        //CharLowerBuffA
        //CharLowerBuffW
        //CharLowerW
        //CharNextA
        //CharNextExA
        //CharNextW
        //CharPrevA
        //CharPrevExA
        //CharPrevW
        //CharToOemA
        //CharToOemBuffA
        //CharToOemBuffW
        //CharToOemW
        //CharUpperA
        //CharUpperBuffA
        //CharUpperBuffW
        //CharUpperW
        //CheckDesktopByThreadId
        //CheckDlgButton
        //CheckMenuItem
        //CheckMenuRadioItem
        //CheckRadioButton
        //CheckWindowThreadDesktop

        /// <summary>
        ///   Determines which, if any, of the child windows belonging to a parent window contains the specified point. The search is restricted to immediate child windows. Grandchildren, and deeper descendant windows are not searched
        /// </summary>
        /// <param name = "hWndParent">A handle to the parent window</param>
        /// <param name = "point">A structure that defines the client coordinates, relative to hWndParent, of the point to be checked</param>
        /// <returns>The return value is a handle to the child window that contains the point, even if the child window is hidden or disabled. If the point lies outside the parent window, the return value is NULL</returns>
        /// <remarks>
        ///   http://msdn.microsoft.com/en-us/library/ms632676(v=vs.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr ChildWindowFromPoint(IntPtr hWndParent, GDIStructures.POINT point);


        /// <summary>
        ///   Determines which, if any, of the child windows belonging to the specified parent window contains the specified point. The function can ignore invisible, disabled, and transparent child windows.
        ///   The search is restricted to immediate child windows. Grandchildren and deeper descendants are not searched
        /// </summary>
        /// <param name = "hWndParent">A handle to the parent window</param>
        /// <param name = "pt">A structure that defines the client coordinates (relative to hwndParent) of the point to be checked</param>
        /// <param name = "uFlags"></param>
        /// <returns>The child windows to be skipped</returns>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr ChildWindowFromPointEx(IntPtr hWndParent, GDIStructures.POINT pt, int uFlags);




        //CliImmSetHotKey
        //ClientThreadSetup
        //ClientToScreen
        //ClipCursor
        //CloseClipboard
        //CloseDesktop
        //CloseGestureInfoHandle
        //CloseTouchInputHandle
        //CloseWindow
        //CloseWindowStation
        //ConsoleControl
        //ControlMagnification
        //CopyAcceleratorTableA
        //CopyAcceleratorTableW
        //CopyIcon
        //CopyImage
        //CopyRect
        //CountClipboardFormats
        //CreateAcceleratorTableA
        //CreateAcceleratorTableW
        //CreateCaret
        //CreateCursor
        //CreateDesktopA
        //CreateDesktopExA
        //CreateDesktopExW
        //CreateDesktopW
        //CreateDialogIndirectParamA
        //CreateDialogIndirectParamAorW
        //CreateDialogIndirectParamW
        //CreateDialogParamA
        //CreateDialogParamW
        //CreateIcon
        //CreateIconFromResource
        //CreateIconFromResourceEx
        //CreateIconIndirect
        //CreateMDIWindowA
        //CreateMDIWindowW
        //CreateMenu
        /*CreatePopupMenu
        CreateSystemThreads
        CreateWindowExA
        CreateWindowExW
        CreateWindowStationA
        CreateWindowStationW
        CsrBroadcastSystemMessageExW
        CtxInitUser32
        DdeAbandonTransaction
        DdeAccessData
        DdeAddData
        DdeClientTransaction
        DdeCmpStringHandles
        DdeConnect
        DdeConnectList
        DdeCreateDataHandle
        DdeCreateStringHandleA
        DdeCreateStringHandleW
        DdeDisconnect
        DdeDisconnectList
        DdeEnableCallback
        DdeFreeDataHandle
        DdeFreeStringHandle
        DdeGetData
        DdeGetLastError
        DdeGetQualityOfService
        DdeImpersonateClient
        DdeInitializeA
        DdeInitializeW
        DdeKeepStringHandle
        DdeNameService
        DdePostAdvise
        DdeQueryConvInfo
        DdeQueryNextServer
        DdeQueryStringA
        DdeQueryStringW
        DdeReconnect
        DdeSetQualityOfService
        DdeSetUserHandle
        DdeUnaccessData
        DdeUninitialize
        DefDlgProcA
        DefDlgProcW
        DefFrameProcA
        DefFrameProcW
        DefMDIChildProcA
        DefMDIChildProcW
        DefRawInputProc
        DefWindowProcA
        DefWindowProcW
        DeferWindowPos
        DeleteMenu
        DeregisterShellHookWindow
        DestroyAcceleratorTable
        DestroyCaret
        DestroyCursor
         */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool DestroyIcon(IntPtr handle);

        //DestroyMenu
        //DestroyReasons

        /// <summary>
        ///   Destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages
        ///   to the window to deactivate it and remove the keyboard focus from it
        /// </summary>
        /// <param name = "hWnd">A handle to the window to be destroyed</param>
        /// <returns>If the function succeeds, the return value is nonzero</returns>
        /// <remarks>
        ///   http://msdn.microsoft.com/en-us/library/ms632682(VS.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool DestroyWindow(IntPtr hWnd);



        /*
        DeviceEventWorker
        DialogBoxIndirectParamA
        DialogBoxIndirectParamAorW
        DialogBoxIndirectParamW
        DialogBoxParamA
        DialogBoxParamW
        DisableProcessWindowsGhosting
        DispatchMessageA
        DispatchMessageW
        DisplayConfigGetDeviceInfo
        DisplayConfigSetDeviceInfo
        DisplayExitWindowsWarnings
        DlgDirListA
        DlgDirListComboBoxA
        DlgDirListComboBoxW
        DlgDirListW
        DlgDirSelectComboBoxExA
        DlgDirSelectComboBoxExW
        DlgDirSelectExA
        DlgDirSelectExW
        DoSoundConnect
        DoSoundDisconnect
        DragDetect
        DragObject
        DrawAnimatedRects
        DrawCaption
        DrawCaptionTempA
        DrawCaptionTempW
        DrawEdge
        DrawFocusRect
        DrawFrame
        DrawFrameControl
        DrawIcon
        DrawIconEx
        DrawMenuBar
        DrawMenuBarTemp
        DrawStateA
        DrawStateW
        DrawTextA
        DrawTextExA
        DrawTextExW
        DrawTextW
        DwmGetDxSharedSurface
        DwmStartRedirection
        DwmStopRedirection
        EditWndProc
        EmptyClipboard
        EnableMenuItem
        EnableScrollBar
        EnableWindow
        EndDeferWindowPos
        EndDialog
        EndMenu
        EndPaint
        EndTask
        EnterReaderModeHelper
        */

        /// <summary>
        ///   Enumerates the child windows that belong to the specified parent window by passing the handle
        ///   to each child window, in turn, to an application-defined callback function. EnumChildWindows
        ///   continues until the last child window is enumerated or the callback function returns FALSE
        /// </summary>
        /// <param name = "windowHandleParent">A Handle to the window containing the control whose child windows are to be enumerated.
        ///   If this parameter is NULL, this function is equivalent to EnumWindows</param>
        /// <param name = "lpEnumFunc">A pointer to an application-defined callback function</param>
        /// <param name = "lParam">An application-defined value to be passed to the callback function</param>
        /// <returns>The return value is not used.</returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool EnumChildWindows(IntPtr windowHandleParent, EnumWindowsCallBack lpEnumFunc, IntPtr lParam);

        //EnumClipboardFormats

        /// <summary>
        ///   Enumerates all top-level windows associated with the specified desktop
        /// </summary>
        /// <param name = "hDesktop">Enumerates all top-level windows associated with the specified desktop</param>
        /// <param name = "lpfn">A pointer to an application-defined EnumWindowsProc callback function</param>
        /// <param name = "lParam">An application-defined value to be passed to the callback function</param>
        /// <returns>If the function fails or is unable to perform the enumeration, the return value is zero</returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumWindowsCallBack lpfn, IntPtr lParam);

        /*
        EnumDesktopsA
        EnumDesktopsW
        EnumDisplayDevicesA
        EnumDisplayDevicesW
        EnumDisplayMonitors
        EnumDisplaySettingsA
        EnumDisplaySettingsExA
        EnumDisplaySettingsExW
        EnumDisplaySettingsW
        EnumPropsA
        EnumPropsExA
        EnumPropsExW
        EnumPropsW
        EnumThreadWindows
        EnumWindowStationsA
        EnumWindowStationsW
        EnumWindows
        EqualRect
        ExcludeUpdateRgn
        ExitWindowsEx
        FillRect
        */

        /// <summary>
        ///   Retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search
        /// </summary>
        /// <param name = "lpClassName">The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function.If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter</param>
        /// <param name = "lpWindowName">The window name (the window's title). If this parameter is NULL, all window names match</param>
        /// <returns>If the function succeeds, the return value is a handle to the window that has the specified class name and window name. If the function fails, the return value is NULL</returns>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr FindWindow(String lpClassName, String lpWindowName);

        /// <summary>
        ///   Retrieves a handle to a window whose class name and window name match the specified strings. The function searches child windows, beginning with the one following the specified child window.
        /// </summary>
        /// <param name = "hwndParent">A handle to the parent window whose child windows are to be searched.If hwndParent is NULL, the function uses the desktop window as the parent window</param>
        /// <param name = "hwndChildAfter">A handle to a child window. If hwndChildAfter is NULL, the search begins with the first child window of hwndParent</param>
        /// <param name = "lpszClass">The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function</param>
        /// <param name = "lpszWindow">The window name (the window's title). If this parameter is NULL, all window names match</param>
        /// <returns>If the function succeeds, the return value is a handle to the window that has the specified class and window names.If the function fails, the return value is NULL.</returns>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, String lpszClass, String lpszWindow);


        /*
        FlashWindow
        FlashWindowEx
        FrameRect
        FreeDDElParam
        FrostCrashedWindow
        GetActiveWindow
        GetAltTabInfo
        GetAltTabInfoA
        GetAltTabInfoW
        */

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr GetAncestor(IntPtr hwnd, int gaFlags);

        /*
        GetAppCompatFlags
        GetAppCompatFlags2
        GetAsyncKeyState
        GetCapture
        GetCaretBlinkTime
        GetCaretPos
        GetClassInfoA
        GetClassInfoExA
        GetClassInfoExW
        GetClassInfoW
        GetClassLongA
        GetClassLongW
        GetClassNameA
        GetClassNameW
        GetClassWord
        GetClientRect
        GetClipCursor
        GetClipboardData
        GetClipboardFormatNameA
        GetClipboardFormatNameW
        GetClipboardOwner
        GetClipboardSequenceNumber
        GetClipboardViewer
        GetComboBoxInfo
        GetCursor
        GetCursorFrameInfo
        GetCursorInfo
         */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool GetCursorPos(out GDIStructures.POINT lpPoint);

        /*
        GetDC
        GetDCEx
        GetDesktopWindow
        GetDialogBaseUnits
        GetDisplayConfigBufferSizes
        GetDlgCtrlID
        */

        /// <summary>
        ///   Retrieves a handle to a control in the specified dialog box
        /// </summary>
        /// <param name = "hDlg">A handle to the dialog box that contains the control.</param>
        /// <param name = "nIDDlgItem">The identifier of the control to be retrieved.</param>
        /// <returns>If the function succeeds, the return value is the window handle of the specified control</returns>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem);


        /*
GetDlgItemInt
GetDlgItemTextA
GetDlgItemTextW
GetDoubleClickTime
GetFocus
GetForegroundWindow
GetGUIThreadInfo
GetGestureConfig
GetGestureExtraArgs
GetGestureInfo
GetGuiResources
GetIconInfo
GetIconInfoExA
GetIconInfoExW
GetInputDesktop
GetInputLocaleInfo
GetInputState
GetInternalWindowPos
GetKBCodePage
GetKeyNameTextA
GetKeyNameTextW
GetKeyState
GetKeyboardLayout
GetKeyboardLayoutList
GetKeyboardLayoutNameA
GetKeyboardLayoutNameW
GetKeyboardState
GetKeyboardType
GetLastActivePopup
GetLastInputInfo
GetLayeredWindowAttributes
GetListBoxInfo
GetMagnificationDesktopColorEffect
GetMagnificationDesktopMagnification
GetMagnificationLensCtxInformation
GetMenu
GetMenuBarInfo
GetMenuCheckMarkDimensions
GetMenuContextHelpId
GetMenuDefaultItem
GetMenuInfo
GetMenuItemCount
GetMenuItemID
GetMenuItemInfoA
GetMenuItemInfoW
GetMenuItemRect
GetMenuState
GetMenuStringA
GetMenuStringW
GetMessageA
GetMessageExtraInfo
GetMessagePos
GetMessageTime
GetMessageW
GetMonitorInfoA
GetMonitorInfoW
GetMouseMovePointsEx
GetNextDlgGroupItem
GetNextDlgTabItem
GetOpenClipboardWindow
         */

        /// <summary>
        ///   Retrieves a handle to the specified window's parent or owner
        /// </summary>
        /// <param name = "windowHandle">A handle to the window whose parent window handle is to be retrieved</param>
        /// <returns>If the window is a child window, the return value is a Handle to the window containing the control.
        ///   If the window is a top-level window with the WS_POPUP style, the return value is a handle to 
        ///   the owner window</returns>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr GetParent(IntPtr windowHandle);

        /*
GetPhysicalCursorPos
GetPriorityClipboardFormat
GetProcessDefaultLayout
GetProcessWindowStation
GetProgmanWindow
GetPropA
GetPropW
GetQueueStatus
GetRawInputBuffer
GetRawInputData
GetRawInputDeviceInfoA
GetRawInputDeviceInfoW
GetRawInputDeviceList
GetReasonTitleFromReasonCode
GetRegisteredRawInputDevices
GetScrollBarInfo
GetScrollInfo
GetScrollPos
GetScrollRange
GetSendMessageReceiver
GetShellWindow
GetSubMenu
GetSysColor
GetSysColorBrush
GetSystemMenu
         */

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern int GetSystemMetrics(int nIndex);

        /*
GetTabbedTextExtentA
GetTabbedTextExtentW
GetTaskmanWindow
GetThreadDesktop
GetTitleBarInfo
GetTopLevelWindow
GetTopWindow
GetTouchInputInfo
GetUpdateRect
GetUpdateRgn
GetUpdatedClipboardFormats
GetUserObjectInformationA
GetUserObjectInformationW
GetUserObjectSecurity
GetWinStationInfo
GetWindow
GetWindowCompositionAttribute
GetWindowCompositionInfo
GetWindowContextHelpId
GetWindowDC
GetWindowDisplayAffinity
*/


        /// <summary>
        ///   Retrieves information about the specified window
        /// </summary>
        /// <param name = "hwnd">A handle to the window whose information is to be retrieved</param>
        /// <param name = "pwi">A pointer to a WINDOWINFO structure to receive the information. 
        ///   to sizeof(WINDOWINFO) before calling this function.
        /// </param>
        /// <returns>Succeeds - nonzero. Fails - zero</returns>
        /// <remarks>
        ///   GetWindowInfo Function: http://msdn.microsoft.com/en-us/library/ms633516(VS.85).aspx
        ///   WINDOWINFO Structure: http://msdn.microsoft.com/en-us/library/ms632610(v=VS.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool GetWindowInfo(IntPtr hwnd, ref WINDOWINFO pwi);

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);

        /*
        GetWindowMinimizeRect
        GetWindowModuleFileName
        GetWindowModuleFileNameA
        GetWindowModuleFileNameW
        GetWindowPlacement
        */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool GetWindowRect(IntPtr hWnd, out GDIStructures.RECT lpRect);



        /*
        GetWindowRgn
        GetWindowRgnBox
        GetWindowRgnEx
        GetWindowTextLengthA
        GetWindowTextLengthW
         */

        /// <summary>
        ///   Copies the text of the specified window's title bar (if it has one) into a buffer
        /// </summary>
        /// <param name = "windowHandle">A handle to the window or control containing the text</param>
        /// <param name = "lpString">The buffer that will receive the text. If the string is as long or longer than the buffer, the string is truncated and terminated with a null character</param>
        /// <param name = "nMaxCount">The maximum number of characters to copy to the buffer, including the null character</param>
        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = true, ThrowOnUnmappableChar = true)]
        [return: MarshalAs(UnmanagedType.I4)]
        internal static extern int GetWindowText(IntPtr windowHandle, StringBuilder lpString, int nMaxCount);

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

        /*
       GetWindowWord
       GhostWindowFromHungWindow
       GrayStringA
       GrayStringW
       HideCaret
       HiliteMenuItem
       HungWindowFromGhostWindow
       IMPGetIMEA
       IMPGetIMEW
       IMPQueryIMEA
       IMPQueryIMEW
       IMPSetIMEA
       IMPSetIMEW
       ImpersonateDdeClientWindow
       InSendMessage
       InSendMessageEx
       InflateRect
       InitializeLpkHooks
       InsertMenuA
       InsertMenuItemA
       InsertMenuItemW
       InsertMenuW
       InternalGetWindowIcon
       InternalGetWindowText
       IntersectRect
         */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, [MarshalAs(UnmanagedType.Bool)] bool bErase);

        /*
InvalidateRgn
InvertRect
IsCharAlphaA
IsCharAlphaNumericA
IsCharAlphaNumericW
IsCharAlphaW
IsCharLowerA
IsCharLowerW
IsCharUpperA
IsCharUpperW
IsChild
IsClipboardFormatAvailable
IsDialogMessage
IsDialogMessageA
IsDialogMessageW
IsDlgButtonChecked
IsGUIThread
IsHungAppWindow
IsIconic
IsMenu
IsProcessDPIAware
IsRectEmpty
IsSETEnabled
IsServerSideWindow
IsThreadDesktopComposited
IsTopLevelWindow
IsTouchWindow
IsWinEventHookInstalled
         */

        /// <summary>
        ///   Determines whether the specified window handle identifies an existing window
        /// </summary>
        /// <param name = "hWnd">A handle to the window to be tested</param>
        /// <returns>If the window handle identifies an existing window, the return value is nonzero</returns>
        /// <remarks>
        ///   Handle Recycling: http://blogs.msdn.com/b/oldnewthing/archive/2007/07/17/3903614.aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool IsWindow(IntPtr hWnd);

        /*
        IsWindowEnabled
        IsWindowInDestroy
        IsWindowRedirectedForPrint
        IsWindowUnicode
         */

        /// <summary>
        ///   Determines the visibility state of the specified window
        /// </summary>
        /// <param name = "hWnd">A handle to the window to be tested</param>
        /// <returns>If the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, the return value is zero. </returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool IsWindowVisible(IntPtr hWnd);

        /*
        IsWow64Message
        IsZoomed
        KillTimer
        LoadAcceleratorsA
        LoadAcceleratorsW
        LoadBitmapA
        LoadBitmapW
        LoadCursorFromFileA
        LoadCursorFromFileW
         */

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);

        /*
        LoadIconA
        LoadIconW
        LoadImageA
        LoadImageW
        LoadKeyboardLayoutA
        LoadKeyboardLayoutEx
        LoadKeyboardLayoutW
        LoadLocalFonts
        LoadMenuA
        LoadMenuIndirectA
        LoadMenuIndirectW
        LoadMenuW
        LoadRemoteFonts
        LoadStringA
        LoadStringW
        LockSetForegroundWindow
        LockWindowStation
        LockWindowUpdate
        LockWorkStation
        LogicalToPhysicalPoint
        LookupIconIdFromDirectory
        LookupIconIdFromDirectoryEx
        MBToWCSEx
        MB_GetString
        MapDialogRect
        MapVirtualKeyA
        MapVirtualKeyExA
        MapVirtualKeyExW
        MapVirtualKeyW
        MapWindowPoints
        MenuItemFromPoint
        MenuWindowProcA
        MenuWindowProcW
        MessageBeep
        MessageBoxA
        MessageBoxExA
        MessageBoxExW
        MessageBoxIndirectA
        MessageBoxIndirectW
        MessageBoxTimeoutA
        MessageBoxTimeoutW
        MessageBoxW
        ModifyMenuA
        ModifyMenuW
        MonitorFromPoint
        MonitorFromRect
        MonitorFromWindow
        MoveWindow
        MsgWaitForMultipleObjects
        MsgWaitForMultipleObjectsEx
        NotifyOverlayWindow
        NotifyWinEvent
        OemKeyScan
        OemToCharA
        OemToCharBuffA
        OemToCharBuffW
        OemToCharW
        OffsetRect
        OpenClipboard
        OpenDesktopA
        OpenDesktopW
        OpenIcon
        OpenInputDesktop
        OpenThreadDesktop
        OpenWindowStationA
        OpenWindowStationW
        PackDDElParam
        PaintDesktop
        PaintMenuBar
        PaintMonitor
        PeekMessageA
        PeekMessageW
        PhysicalToLogicalPoint
        PostMessageA
        PostMessageW
        PostQuitMessage
        PostThreadMessageA
        PostThreadMessageW
        PrintWindow
        PrivateExtractIconExA
        PrivateExtractIconExW
        PrivateExtractIconsA
        PrivateExtractIconsW
        PrivateRegisterICSProc
        PtInRect
        QueryDisplayConfig
        QuerySendMessage
        */

        /// <summary>
        ///   Retrieves a handle to the child window at the specified point.
        /// </summary>
        /// <param name = "hwndParent">A handle to the window whose child is to be retrieved.</param>
        /// <param name = "ptParentClientCoords">A POINT structure that defines the client coordinates of the point to be checked</param>
        /// <returns>Handle to the child window that contains the specified point</returns>
        /// <remarks>
        ///   The search is restricted to immediate child windows; grandchildren and deeper descendant windows are not searched.
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr RealChildWindowFromPoint(IntPtr hwndParent, GDIStructures.POINT ptParentClientCoords);

        /// <summary>
        ///   Retrieves a string that specifies the window type.
        /// </summary>
        /// <param name = "windowHandle">A handle to the window whose type will be retrieved</param>
        /// <param name = "pszType">A pointer to a string that receives the window type</param>
        /// <param name = "cchType">The length, in characters, of the buffer pointed to by the pszType parameter</param>
        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = true, ThrowOnUnmappableChar = true)]
        internal static extern void RealGetWindowClass(IntPtr windowHandle, StringBuilder pszType, uint cchType);

        /*
        ReasonCodeNeedsBugID
        ReasonCodeNeedsComment
        RecordShutdownReason
        RedrawWindow
        RegisterClassA
        RegisterClassExA
        RegisterClassExW
        RegisterClassW
        RegisterClipboardFormatA
        RegisterClipboardFormatW
        RegisterDeviceNotificationA
        RegisterDeviceNotificationW
        RegisterErrorReportingDialog
        RegisterFrostWindow
        RegisterGhostWindow
        RegisterHotKey
        RegisterLogonProcess
        RegisterMessagePumpHook
        RegisterPowerSettingNotification
        RegisterRawInputDevices
        RegisterServicesProcess
        RegisterSessionPort
        RegisterShellHookWindow
        RegisterSystemThread
        RegisterTasklist
        RegisterTouchWindow
        RegisterUserApiHook
        RegisterWindowMessageA
        RegisterWindowMessageW
        ReleaseCapture
        ReleaseDC
        RemoveClipboardFormatListener
        RemoveMenu
        RemovePropA
        RemovePropW
        ReplyMessage
        ResolveDesktopForWOW
        ReuseDDElParam
         */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool ScreenToClient(IntPtr hWnd, ref GDIStructures.POINT lpPoint);

        /*
ScrollChildren
ScrollDC
ScrollWindow
ScrollWindowEx
SendDlgItemMessageA
SendDlgItemMessageW
SendIMEMessageExA
SendIMEMessageExW
*/

        [DllImport("user32.dll", SetLastError = true)]
        internal static extern int SendInput(uint nInputs, ref INPUT pInputs, int cbSize);

        /*
SendMessageA
SendMessageCallbackA
SendMessageCallbackW
SendMessageTimeoutA
SendMessageTimeoutW
SendMessageW
SendNotifyMessageA
SendNotifyMessageW
SetActiveWindow
SetCapture
SetCaretBlinkTime
SetCaretPos
SetClassLongA
SetClassLongW
SetClassWord
SetClipboardData
SetClipboardViewer
SetCursor
SetCursorContents
SetCursorPos
SetDebugErrorLevel
SetDeskWallpaper
SetDisplayConfig
SetDlgItemInt
SetDlgItemTextA
SetDlgItemTextW
SetDoubleClickTime
SetFocus
*/

        /// <summary>
        ///   Brings the thread that created the specified window into the foreground and activates the window.
        ///   Keyboard input is directed to the window, and various visual cues are changed for the user
        /// </summary>
        /// <param name = "windowHandle">A handle to the window that should be activated and brought to the foreground</param>
        /// <returns>If the window was brought to the foreground, the return value is nonzero</returns>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool SetForegroundWindow(IntPtr windowHandle);

        /*
        SetGestureConfig
        SetInternalWindowPos
        SetKeyboardState
        SetLastErrorEx
        SetLayeredWindowAttributes
        SetMagnificationDesktopColorEffect
        SetMagnificationDesktopMagnification
        SetMagnificationLensCtxInformation
        SetMenu
        SetMenuContextHelpId
        SetMenuDefaultItem
        SetMenuInfo
        SetMenuItemBitmaps
        SetMenuItemInfoA
        SetMenuItemInfoW
        SetMessageExtraInfo
        SetMessageQueue
        SetMirrorRendering
        SetParent
        SetPhysicalCursorPos
        SetProcessDPIAware
        SetProcessDefaultLayout
        SetProcessWindowStation
        SetProgmanWindow
        SetPropA
        SetPropW
        SetRect
        SetRectEmpty
        SetScrollInfo
        SetScrollPos
        SetScrollRange
        SetShellWindow
        SetShellWindowEx
        SetSysColors
        SetSysColorsTemp
         */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool SetSystemCursor(IntPtr hcur, uint id);

        /*
        SetSystemMenu
        SetTaskmanWindow
        SetThreadDesktop
        SetTimer
        SetUserObjectInformationA
        SetUserObjectInformationW
        SetUserObjectSecurity
        SetWinEventHook
        SetWindowCompositionAttribute
        SetWindowContextHelpId
        SetWindowDisplayAffinity
        SetWindowLongA
        SetWindowLongW
        SetWindowPlacement
        SetWindowPos
        SetWindowRgn
        SetWindowRgnEx
        SetWindowStationUser
        */

        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = true, ThrowOnUnmappableChar = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool SetWindowText(IntPtr windowHandle, string lpString);


        /*
        SetWindowWord
        SetWindowsHookA
        SetWindowsHookExA
        SetWindowsHookExW
        SetWindowsHookW
        SfmDxBindSwapChain
        SfmDxGetSwapChainStats
        SfmDxOpenSwapChain
        SfmDxQuerySwapChainBindingStatus
        SfmDxReleaseSwapChain
        SfmDxReportPendingBindingsToDwm
        SfmDxSetSwapChainBindingStatus
        SfmDxSetSwapChainStats
        ShowCaret
        ShowCursor
        ShowOwnedPopups
        ShowScrollBar
        ShowStartGlass
        ShowSystemCursor
        ShowWindow
        */

        /// <summary>
        ///   Sets the show state of a window created by a different thread
        /// </summary>
        /// <param name = "hWnd">A handle to the window</param>
        /// <param name = "nCmdShow">Controls how the window is to be shown.</param>
        /// <returns>If the window was previously visible, the return value is nonzero. If the window was previously hidden, the return value is zero</returns>
        /// <remarks>
        ///   http://msdn.microsoft.com/en-us/library/ms633549(VS.85).aspx
        /// </remarks>
        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);


        /*
        ShutdownBlockReasonCreate
        ShutdownBlockReasonDestroy
        ShutdownBlockReasonQuery
        SoftModalMessageBox
        SoundSentry
        SubtractRect
        SwapMouseButton
        SwitchDesktop
        SwitchDesktopWithFade
        SwitchToThisWindow
        SystemParametersInfoA
        SystemParametersInfoW
        TabbedTextOutA
        TabbedTextOutW
        TileChildWindows
        TileWindows
        ToAscii
        ToAsciiEx
        ToUnicode
        ToUnicodeEx
        TrackMouseEvent
        TrackPopupMenu
        TrackPopupMenuEx
        TranslateAccelerator
        TranslateAcceleratorA
        TranslateAcceleratorW
        TranslateMDISysAccel
        TranslateMessage
        TranslateMessageEx
        UnhookWinEvent
        UnhookWindowsHook
        UnhookWindowsHookEx
        UnionRect
        UnloadKeyboardLayout
        UnlockWindowStation
        UnpackDDElParam
        UnregisterClassA
        UnregisterClassW
        UnregisterDeviceNotification
        UnregisterHotKey
        UnregisterMessagePumpHook
        UnregisterPowerSettingNotification
        UnregisterSessionPort
        UnregisterTouchWindow
        UnregisterUserApiHook
        UpdateLayeredWindow
        UpdateLayeredWindowIndirect
        UpdatePerUserSystemParameters
         */

        [DllImport("user32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool UpdateWindow(IntPtr hWnd);


        /*
UpdateWindowTransform
User32InitializeImmEntryTable
UserClientDllInitialize
UserHandleGrantAccess
UserLpkPSMTextOut
UserLpkTabbedTextOut
UserRealizePalette
UserRegisterWowHandlers
VRipOutput
VTagOutput
ValidateRect
ValidateRgn
VkKeyScanA
VkKeyScanExA
VkKeyScanExW
VkKeyScanW
WCSToMBEx
WINNLSEnableIME
WINNLSGetEnableStatus
WINNLSGetIMEHotkey
WaitForInputIdle
WaitMessage
WinHelpA
WinHelpW
WindowFromDC
WindowFromPhysicalPoint
*/


        [DllImport("user32.dll", SetLastError = true)]
        internal static extern IntPtr WindowFromPoint(GDIStructures.POINT point);


        /*
        _UserTestTokenForInteractive
        gSharedInfo
        gapfnScSendMessage
        keybd_event
        mouse_event
        wsprintfA
        wsprintfW
        wvsprintfA
        wvsprintfW
        */

    }
}